package com.woniu.order.client;

import com.woniu.model.Result;
import com.woniu.order.cliententity.entity.Station;
import com.woniu.order.cliententity.form.FindByLocationAndJunkForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(name = "station-server",path = "/station")
public interface StationClient {
    /**
     * 根据经纬度和废品种类查询最近站点
     * form :
     * id为废品种类id(只能是一级类别)
     * longitude 经度
     * latitude 纬度
     */
    @PostMapping("/station/findByLocationAndJunk")
    @ApiOperation("根据经纬度和废品种类查询最近站点")
    Result<Station> findByLocationAndJunk(@RequestBody FindByLocationAndJunkForm form);

    /**
     * 根据站点id查询站点
     * id 站点id
     */
    @GetMapping("/station/byId/{id}")
    @ApiOperation("根据站点id查找站点")
    public Result<Station> byId(@PathVariable("id") Integer id);
}
